package com.streamer.app

import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.WindowInsetsController
import android.widget.Toast
import androidx.core.view.WindowCompat

import com.google.android.material.switchmaterial.SwitchMaterial
import com.streamer.app.utils.UserManager

class SettingsActivity : BaseActivity() {
    
    private lateinit var switchAutoStart: SwitchMaterial
    private lateinit var switchHighQuality: SwitchMaterial
    private lateinit var menuLogout: android.widget.LinearLayout
    
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_settings_simple)
        
        initViews()
        setupListeners()
    }
    
    private fun initViews() {
        switchAutoStart = findViewById(R.id.switch_auto_start)
        switchHighQuality = findViewById(R.id.switch_high_quality)
        menuLogout = findViewById(R.id.menu_logout)
    }
    
    private fun setupListeners() {
        switchAutoStart.setOnCheckedChangeListener { _, isChecked ->
            Toast.makeText(this, "自动开始直播: ${if (isChecked) "开启" else "关闭"}", Toast.LENGTH_SHORT).show()
        }
        
        switchHighQuality.setOnCheckedChangeListener { _, isChecked ->
            Toast.makeText(this, "高清画质: ${if (isChecked) "开启" else "关闭"}", Toast.LENGTH_SHORT).show()
        }
        
        menuLogout.setOnClickListener {
            // 调用真正的登出功能
            UserManager.logout()
        }
    }


} 